package mockInter01.no1;



class TreeNode {
    int val;
    TreeNode left;
    TreeNode right;
    TreeNode(int x) { val = x; }
}

class Solution {
    public TreeNode invertTree(TreeNode root) {
        if (root == null)
            return null;

        TreeNode temptNode =root.left;
        root.left = root.right;
        root.right = temptNode;
        invertTree(root.left);
        invertTree(root.right);


        return root;
    }


}